#include "StdAfx.h"
#include "BieuThucTong.h"


BieuThucTong::BieuThucTong()
{
	Dau = 1;
}

double BieuThucTong::TinhGiaTri()
{
	if (Dau == 1)
	return BT1.TinhGiaTri() + BT2.TinhGiaTri();
	else return BT1.TinhGiaTri() - BT2.TinhGiaTri();
}
BieuThucTong::BieuThucTong(BieuThuc BTa, BieuThuc BTb){
	BT1 = BTa;
	BT2 = BTb;
}

BieuThuc BieuThucTong::TinhDaoHam()
{
	BieuThucTong KQ;
	KQ.Dau = Dau;
	BT1.TinhDaoHam();
	BT2.TinhDaoHam();
	KQ.BT1 = BT1.TinhDaoHam();
	KQ.BT2 = BT2.TinhDaoHam();
	return KQ;
}


